/**
 * 
 */
package com.pengtu.service.app;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.pengtu.dao.Page;
import com.pengtu.dao.QueryFilter;
import com.pengtu.dao.app.SuperviseGroupDao;
import com.pengtu.dao.app.SupervisorGroupDao;
import com.pengtu.entity.app.SuperviseGroup;
import com.pengtu.entity.app.SupervisorGroup;

/**
 * @author Administrator
 *
 */
@Component
@Transactional
public class SuperviseManager {
	
	private SuperviseGroupDao superviseGroupDao;
	private SupervisorGroupDao supervisorGroupDao;
	
	///************************superviseGroup^^^^^^^^^^^^^^^^^^^^
	@Transactional(readOnly=true)
	public SuperviseGroup findBySeProperty(String propertyName, String value) {
		// TODO Auto-generated method stub
		if("id".equals(propertyName)){
			return superviseGroupDao.findUniqueBy("id", value);
		}
		return superviseGroupDao.findUniqueBy(propertyName, value);
	}
	@Transactional(readOnly=true)
	public Page<SuperviseGroup> findPageSe(final Page<SuperviseGroup> page,
			 final QueryFilter queryFilter) {
		// TODO Auto-generated method stub
		return superviseGroupDao.findPage(page, queryFilter);
	}
	@Transactional(readOnly=true)
	public List<SuperviseGroup> findAllSe() {
		// TODO Auto-generated method stub
		return superviseGroupDao.find();
	}
	
	public void saveSe(SuperviseGroup superviseGroup) {
		// TODO Auto-generated method stub
		superviseGroupDao.save(superviseGroup);
	}
	
	public void deleteSe(String id) {
		// TODO Auto-generated method stub
		superviseGroupDao.delete(id);
	}
	
	
	///************************supervisorGrou^^^^^^^^^^^^^^^^^^^^
	
	@Transactional(readOnly=true)
	public SupervisorGroup findBySorProperty(String propertyName, String value) {
		// TODO Auto-generated method stub
		if("id".equals(propertyName)){
			return supervisorGroupDao.findUniqueBy("id", value);
		}
		return supervisorGroupDao.findUniqueBy(propertyName, value);
	}
	
	@Transactional(readOnly=true)
	public List<SupervisorGroup> findBySorPropertyList(String propertyName, String value) {
		// TODO Auto-generated method stub
		return supervisorGroupDao.findBy(propertyName, value);
	}
	
	@Transactional(readOnly=true)
	public List<SupervisorGroup> find(QueryFilter fileter) {
		// TODO Auto-generated method stub
		return supervisorGroupDao.find(fileter);
	}
	
	@Transactional(readOnly=true)
	public Page<SupervisorGroup> findPageSor(final Page<SupervisorGroup> page,
			 final QueryFilter queryFilter) {
		// TODO Auto-generated method stub
		return supervisorGroupDao.findPage(page, queryFilter);
	}
	
	public void saveSor(SupervisorGroup supervisorGroup) {
		// TODO Auto-generated method stub
		supervisorGroupDao.save(supervisorGroup);
	}
	
	public void deleteSor(String id) {
		// TODO Auto-generated method stub
		supervisorGroupDao.delete(id);
	}
	
	
	
	@Autowired
	public void setSuperviseGroupDao(SuperviseGroupDao superviseGroupDao) {
		this.superviseGroupDao = superviseGroupDao;
	}
	@Autowired
	public void setSupervisorGroupDao(SupervisorGroupDao supervisorGroupDao) {
		this.supervisorGroupDao = supervisorGroupDao;
	}

}
